package com.chain.qs.modules.biz.service;

import com.chain.qs.common.service.CrudService;
import com.chain.qs.modules.biz.dao.HandoverDao;
import com.chain.qs.modules.biz.dao.HandoverExceptionDao;
import com.chain.qs.modules.biz.entity.Handover;
import com.chain.qs.modules.biz.entity.HandoverException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 *  值班设置Service
 * @author wangzhiping
 */
@Service
//@Transactional(readOnly = true)
public class HandoverExceptionService extends CrudService<HandoverExceptionDao,HandoverException> {
    @Transactional(readOnly = false)
    public void save(HandoverException entity) {
        if (entity.getIsNewRecord()){
            entity.preInsert();
            dao.insert(entity);
        }else{
            entity.setFlag(1);
            entity.preUpdate();
            dao.update(entity);
        }
    }
}
